<?php $this->pageTitle = 'Bulk Create Payment Vouchers'; ?>
<div class="main-title no-border">
	<h1>Bulk Create Payment Vouchers</h1>
</div>
<div class="flat_area">
    <div id="ps-payment-voucher-create" class="grid_16 relative">
		<?php if (!empty($paymentVouchers)): ?>
			<?php
			$form = $this->beginWidget('PsActiveForm', array(
				'id' => 'add-payment-voucher-form',
				'enableAjaxValidation' => false,
				'enableClientValidation' => true,
				'clientOptions' => array(
					'validationDelay' => 200,
					'inputContainer' => 'tr',
					'validateOnSubmit' => true,
					'validateOnChange' => false,
				)
					));
			?>
			<div class="grid-view grey">
				<table class="items" width="100%">
					<thead>
						<tr>
							<th scope="row" width="120">PV No</th>
							<th scope="row" width="*">Payee</th>
							<th scope="row" width="60" colspan="2">Amount</th>
							<th scope="row" width="85">Voucher Date</th>
							<th scope="row" width="110">Payment Method</th>
							<th scope="row" width="120">Payment Ref No</th>
							<th scope="row" width="170">Comment</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($paymentVouchers as $i => $paymentVoucher): ?>
							<?php
							$this->renderPartial('_bulk_create_item', array(
								'index' => $i,
								'form' => $form,
								'paymentVoucher' => $paymentVoucher
							));
							?>
						<?php endforeach; ?>
					</tbody>
				</table>
			</div>
			<div class="relative">
				<?php echo CHtml::hiddenField('bulk_action', $_POST['bulk_action']); ?>
				<button type="submit" class="link-button green no-margin with-icon" id="btnFinish">
					<span>Create Payment Vouchers</span>
				</button>
				&nbsp;or <a class="link" href="<?php echo $this->createUrl('commissionPayable/index'); ?>">Cancel</a>
			</div>
			<?php $this->endWidget(); ?>
		<?php endif; ?>

    </div>
</div>